import com.baidu.translate.demo.ParseResult;
import com.baidu.translate.demo.TransApi;

public class Main {

    private static final String APP_ID = "20200702000511484";
    private static final String SECURITY_KEY = "afQHduPCRFty02sM3_ts";

    public static void main(String[] args) {
        TransApi api = new TransApi(APP_ID, SECURITY_KEY);

        String query = "text";//需要翻译的文字
        String transResult = api.getTransResult(query, "auto", "jp");//翻译的语种
        //String parse = ParseResult.parse(transResult);
        String parse = ParseResult.parseresult(transResult);
        System.out.println(parse);
    }

}
